<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>Expand Entity</Title>
			<Shortcut>gexpand</Shortcut>
			<Description>ZEQP Expand Entity自动生成</Description>
			<Author>ZEQP</Author>
			<SnippetTypes>
				<SnippetType>Expansion</SnippetType>
				<SnippetType>SurroundsWith</SnippetType>
			</SnippetTypes>
		</Header>
		<Snippet>
			<Declarations>
        <Literal>
          <ID>name</ID>
          <ToolTip>主表实体名称</ToolTip>
          <Default>Bas_Table</Default>
        </Literal>
			</Declarations>
			<Code Language="csharp">
      <![CDATA[using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PMS.SANY.Util;

namespace PMS.SANY.Entity
{
    /// <summary>
    /// $name$扩展表
    /// </summary>
    public partial class $name$Expand : ExpandEntity
    {
    }

    public partial class $name$Expand : ExpandEntity
    {
        /// <summary>
        /// 主表实体
        /// </summary>
        public $name$ Main { get; set; }

        //在$name$表加上此配置
        ///// <summary>
        ///// 扩展
        ///// </summary>
        //public $name$Expand Expand { get; set; }
    }

    /// <summary>
    /// 实体配置
    /// OnModelCreating
    /// </summary>
    public class $name$ExpandTypeConfig : ExpandEntityTypeConfig<$name$Expand>, IEntityTypeConfiguration<$name$Expand>
    {
        public override void Configure(EntityTypeBuilder<$name$Expand> builder)
        {
            base.Configure(builder);

            #region 主外键关系
            //在$name$表加上此配置
            //builder.HasOne(o => o.Expand).WithOne(o => o.Main).HasForeignKey<$name$Expand>(k => k.Id);
            #endregion

            #region 字段属性:最大长度,是否必需,默认值
            #endregion

            #region 备注
            builder.HasComment("$name$扩展表");
            #endregion

            #region 种子数据
            #endregion
        }
    }
}
]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>
